UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PgahtGFFomvKl3Nmc/ywyARs7UuOfw95jZj1h/zdBpo=' 
WHERE 
  key_id = 'e5fc23afd8eb6900605f3219ba9a640d73d12430bac8b808edc45b0d2d621b39' 
  AND (
    token = 'PgahtGFFomvKl3Nmc/ywyARs7UuOfw95jZj1h/zdBpo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026