UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6QHh1Hoo4w+cm6NsL1MBHBR+uo4Im8SJcSV3k91expI='
WHERE
key_id = '68eff7bab142f951b3afd74934c4568342bd1d7f96125f14efdf46c8eb04d362'
AND (
token = '6QHh1Hoo4w+cm6NsL1MBHBR+uo4Im8SJcSV3k91expI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)