UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DhmX6mbxivnYRtgVW8cn0bvZ+vjIsdRuY4nsksmpWFE='
WHERE
key_id = '953333d2e4bf56f4e4d94a6c4c904cdda4ee0c9ceb23d5f3e0996f5c53d1dcea'
AND (
token = 'DhmX6mbxivnYRtgVW8cn0bvZ+vjIsdRuY4nsksmpWFE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)