UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1ieUg31raxxBMcfmsHp70JVHiz5tK/MAtREyIxBEYVc=' 
WHERE 
  key_id = '36c396ee89fdb2af377a049e06a1a55bcc6fe4abfd2f6a866637de88aead6380' 
  AND (
    token = '1ieUg31raxxBMcfmsHp70JVHiz5tK/MAtREyIxBEYVc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042