UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hY2DwH+lxdVlVywyQrkS8GKHcCBA95pt/r0bjNEBko4=' 
WHERE 
  key_id = 'e7fd73ef817606e3c5d30252e128ae409feeefe84b936b9d9f51ee1eedf6dd7c' 
  AND (
    token = 'hY2DwH+lxdVlVywyQrkS8GKHcCBA95pt/r0bjNEBko4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053