UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'raU722LMuwGgWZAlgRbFQQgIRRpE+xEahqsUJQrISVU=' 
WHERE 
  key_id = '67d2d8a6bbeae2572264149f1e3dadb2c8d73a556f88653c634d4b351841a2d7' 
  AND (
    token = 'raU722LMuwGgWZAlgRbFQQgIRRpE+xEahqsUJQrISVU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041