UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fSl3yRMN4BR//M0Kn9aYriQzu1Ncsq9DPyxYbDapF/o=' 
WHERE 
  key_id = 'fe1e8bb5cd895f36366de08dcdfd82d7a8d12cc7d4b0d0b995bb06d52d25d51b' 
  AND (
    token = 'fSl3yRMN4BR//M0Kn9aYriQzu1Ncsq9DPyxYbDapF/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031