UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bMVXF0D+pZyjofbCIqvYP6aal/YNsK7DMshvHKEobqU='
WHERE
key_id = '9bf0c927e8d54b46f0273db9afac425aefc34f89b50667ffa70287112fbd929b'
AND (
token = 'bMVXF0D+pZyjofbCIqvYP6aal/YNsK7DMshvHKEobqU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)