UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ywzG5NIQYzCmOmgF63JpSDMVVHp1vpAdOb+57ILEI00=' 
WHERE 
  key_id = '78f784e7c9e4f4ff64853039d61ee56fd4dc8db33c0f19c3a673ebaeb38ae7fc' 
  AND (
    token = 'ywzG5NIQYzCmOmgF63JpSDMVVHp1vpAdOb+57ILEI00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033