UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4IzFWPa77flNiYp2fXVtla6f6sSIBvMll3G/AKwjHw4=' 
WHERE 
  key_id = '9f34b84ff812728e35564154d5fc3b79cae6d2a782ed3ac15746e014cc1ed9a6' 
  AND (
    token = '4IzFWPa77flNiYp2fXVtla6f6sSIBvMll3G/AKwjHw4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042