UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9GH0v787z9OXW4j4KXL+eMFr5Xjjt2D3Uz7GiYqcIc0=' 
WHERE 
  key_id = '26845d5d0814e5946e8317c2b96da7ec3ed81f071bdcc38788a82be5c883f290' 
  AND (
    token = '9GH0v787z9OXW4j4KXL+eMFr5Xjjt2D3Uz7GiYqcIc0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028