UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v1xCxk3FUvrs/EN5F/WiEYxHIafYvtfoIYwOqte6DdY=' 
WHERE 
  key_id = '2fd18955ef63fac5d08e766a38680a46293cfb24c8ebc9909575c8fb65e21c9e' 
  AND (
    token = 'v1xCxk3FUvrs/EN5F/WiEYxHIafYvtfoIYwOqte6DdY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028