UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AeTjxSkg2f2r6kxXKrs8RaBc/DL59x9L6YCkVSlJM6s='
WHERE
key_id = 'd8ba4f5c85e98c9bedd33530e5301604bcf6fa4573ee8cac92c23217619ce75b'
AND (
token = 'AeTjxSkg2f2r6kxXKrs8RaBc/DL59x9L6YCkVSlJM6s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)