UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o0ie4nAev0cu68XLSggKdl7NiCs58yPI794l2L/ts9o='
WHERE
key_id = 'ee5382c7495e1cf04beba2ca9d6d391c21f46a5b44e4d10212836b66ec2c705d'
AND (
token = 'o0ie4nAev0cu68XLSggKdl7NiCs58yPI794l2L/ts9o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)