UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vlrzpSFEwvZucD0OWbJLp3NZrtA3f3YWlqL046MZLL8='
WHERE
key_id = '644c694099479466299c101516619ae69e6fb144ff29cadafdb66cc2596a640e'
AND (
token = 'vlrzpSFEwvZucD0OWbJLp3NZrtA3f3YWlqL046MZLL8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)