UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dHY/un7MX7Z6vx5N+MjJlr/gTLxShacP86XJHBOylCg=' 
WHERE 
  key_id = '873da70b83e34101a764f792e6c96bf16089014ea34f2c8888b485e0b4f1156a' 
  AND (
    token = 'dHY/un7MX7Z6vx5N+MjJlr/gTLxShacP86XJHBOylCg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021