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