UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q07p4dE99KT7+7DQKzfTud9fy1dubfJ+Ar9mkLnwE7w='
WHERE
key_id = 'ed41fab815c5a1297d228d020bdd3b8bd8d8b22780896cec0a50cbb875faaceb'
AND (
token = 'q07p4dE99KT7+7DQKzfTud9fy1dubfJ+Ar9mkLnwE7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)