UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DKe6yo95fOtYczXqVqFxSxpM3Y0gojkkvzOSTknU9IE='
WHERE
key_id = 'ab28fd04e4b554f27c98e57221cb93700ba48c99a626402e0f2cb119d957ac4d'
AND (
token = 'DKe6yo95fOtYczXqVqFxSxpM3Y0gojkkvzOSTknU9IE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)