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