UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CV3bSdmhp11qZkVP4tPZP7TyH78ZjPQFg5JU474xOG8='
WHERE
key_id = '12c6624b2115927aea520cd5c1fc5460d7ca867a801fbfcd407f36ce76de1a3a'
AND (
token = 'CV3bSdmhp11qZkVP4tPZP7TyH78ZjPQFg5JU474xOG8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)