UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HOIT4+STzdEmSSbhZ7nk91IH8OzBzfdIuIvFH9scaQc=' 
WHERE 
  key_id = 'e7187f3138bf1cd3f02d616530d09a2f7f3b39b98ce41f1524dec28f4c716ff9' 
  AND (
    token = 'HOIT4+STzdEmSSbhZ7nk91IH8OzBzfdIuIvFH9scaQc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018