UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rPEzSerRmjTziYPzu2enMUbJbx+INqzS4ysmbrNhenc='
WHERE
key_id = '9557ebe50091cce37ee5041ba6d605c11ba5d0a067334c31db6fac135ae3a477'
AND (
token = 'rPEzSerRmjTziYPzu2enMUbJbx+INqzS4ysmbrNhenc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)