UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TnhlbO029UKQt/CCqHD/thiQ7qkCs3r4Zuc6ItxZdok=' 
WHERE 
  key_id = '8d0fc1fdfe11870cbc8d8d9aa96826c02a0c513080b9bef4513f34a2466c483b' 
  AND (
    token = 'TnhlbO029UKQt/CCqHD/thiQ7qkCs3r4Zuc6ItxZdok=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032