UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uMpOROwDkU1BxngDdujkR21aWS+CKx7jhRg/XwvtXRg=' 
WHERE 
  key_id = '33ad1c07d26b3cdab40a1f5484bc89b2f13447fd6498881e4ddd2190479e85b5' 
  AND (
    token = 'uMpOROwDkU1BxngDdujkR21aWS+CKx7jhRg/XwvtXRg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016