UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XkrHN4n3BRBOXiAnX0P1O+6i/1apOcpTS3SKXrXQ8N8='
WHERE
key_id = '53d9e6169d0084bdf253c67175247dd8e170467da11065690a47afa457d83f02'
AND (
token = 'XkrHN4n3BRBOXiAnX0P1O+6i/1apOcpTS3SKXrXQ8N8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)