UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v4x4XPiOBywYpRrvFG4hPQZ/7W6DKPMpTvQdQdidsr4=' 
WHERE 
  key_id = '09d16834e0fd0310415b66579bad42954d05a2cade1bd0b4e7b9e6f51068baa8' 
  AND (
    token = 'v4x4XPiOBywYpRrvFG4hPQZ/7W6DKPMpTvQdQdidsr4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062