UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yqia/oSQCjbTSMtbIYxeLcGbHGiIPouElPCZiSwYFK8='
WHERE
key_id = '4b83ed3bd765f28c26059f66a34343125e88968ca06ccc5ad447743047d10cae'
AND (
token = 'Yqia/oSQCjbTSMtbIYxeLcGbHGiIPouElPCZiSwYFK8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)