UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'udwUOWhICCb5k+0ubtC4gLFwkBHY5XtofnWeLq0T1HA='
WHERE
key_id = '02c1942e611cc5b39ce8fa0d7d166ce5aa25552e265770620932c8936a5519bb'
AND (
token = 'udwUOWhICCb5k+0ubtC4gLFwkBHY5XtofnWeLq0T1HA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)