UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gigVhuRdn4CJ/h/E10uB9afoH3wYnuKA3HoaV7vPfXs=' 
WHERE 
  key_id = 'b623702f5b27d36a455700f2146976c57e5ca13650c9c6f3ffa469a87c85ef4c' 
  AND (
    token = 'gigVhuRdn4CJ/h/E10uB9afoH3wYnuKA3HoaV7vPfXs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027