UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kj2YW6dIRR2dC0L+LrZF+yyltx6BFGk60SYPJorUx7Q=' 
WHERE 
  key_id = 'ce17b97083d4faee12ed39bfa5491eb67f2f4f00c2a18c21c7135f0a00141014' 
  AND (
    token = 'kj2YW6dIRR2dC0L+LrZF+yyltx6BFGk60SYPJorUx7Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033