UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uERj82fXevIFQAhDOpEYh0Pgzu/oE7Rk/Njpe6dSOsQ='
WHERE
key_id = '3cbeb956ab5e7e7f7e792c122c158354a94be4628c0732896e4aa2c06133a9dc'
AND (
token = 'uERj82fXevIFQAhDOpEYh0Pgzu/oE7Rk/Njpe6dSOsQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)