UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4qzspKGYHl4tX82B3rXeYycJHsK4vUSEUHZZZR0sz7k=' 
WHERE 
  key_id = 'b96360b58314317466b7fc45d2f7d76f3975b4617c0bf0293c77371531261272' 
  AND (
    token = '4qzspKGYHl4tX82B3rXeYycJHsK4vUSEUHZZZR0sz7k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028