UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xNSRklvUCDHcPUm7Edpc9mkIaDi5UyCe/OCIkW6thQ8='
WHERE
key_id = 'f13d66cc1611b2fb7aaaa0c12fb60cf45574242972dc1662a46b3f02cde03098'
AND (
token = 'xNSRklvUCDHcPUm7Edpc9mkIaDi5UyCe/OCIkW6thQ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)