UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0febS1KyHKEh7J3wRRmsLj1QGk9+iJdiOSbrKzTCSaY='
WHERE
key_id = '7bdb85bc39bb1b988a7af6bb6e8359c80ca938d833fcb3c62ea2dd74df46494a'
AND (
token = '0febS1KyHKEh7J3wRRmsLj1QGk9+iJdiOSbrKzTCSaY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)