UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7hkCH165jNvfu9999ckLh/h5INKwundlc1hYxPisKMA='
WHERE
key_id = '6890d0f7068ac9530d2212c420c124240817a8da180fff0b4804d28c0458e506'
AND (
token = '7hkCH165jNvfu9999ckLh/h5INKwundlc1hYxPisKMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)